<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>编辑产品参数</title>
    <%@include file="/WEB-INF/layouts/edit-header.jsp" %>
</head>
<body>

<div class="create-page tpanel">
    <div class="panel-content">
        <div class="container-fluid">

            <form id="createForm" class="form-horizontal">
                <input type="hidden" name="id" value="${entity.id}"/>

                <div class="form-group form-group-first">
                    <label for="no" class="col-sm-2 control-label">编号</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control"
                               id="no" name="no"
                               value="${entity.no}"
                               placeholder="请输入编号"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group ">
                    <label for="price" class="col-sm-2 control-label">价格</label>
                    <div class="col-sm-8">
                        <input type="number" class="form-control"
                               id="price" name="price"
                               value="${entity.price}"
                               placeholder="请输入价格(实际交易价)"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group ">
                    <label for="sales" class="col-sm-2 control-label">销量</label>
                    <div class="col-sm-8">
                        <input type="number" class="form-control"
                               id="sales" name="sales"
                               value="${entity.sales}"
                               placeholder="请输入销量(实际销售量)"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group ">
                    <label for="type" class="col-sm-2 control-label">类型</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control"
                               id="type" name="type"
                               value="${entity.type}"
                               placeholder="请输入类型"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group ">
                    <label for="specifications" class="col-sm-2 control-label">规格</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control"
                               id="specifications" name="specifications"
                               value="${entity.specifications}"
                               placeholder="请输入规格"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group ">
                    <label for="material" class="col-sm-2 control-label">材质</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control"
                               id="material" name="material"
                               value="${entity.material}"
                               placeholder="请输入材质"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group ">
                    <label for="color" class="col-sm-2 control-label">颜色</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control"
                               id="color" name="color"
                               value="${entity.color}"
                               placeholder="请输入颜色"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group ">
                    <label for="brand" class="col-sm-2 control-label">品牌</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control"
                               id="brand" name="brand"
                               value="${entity.brand}"
                               placeholder="请输入品牌"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group ">
                    <label for="model" class="col-sm-2 control-label">型号</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control"
                               id="model" name="model"
                               value="${entity.model}"
                               placeholder="请输入型号"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group ">
                    <label for="inventory" class="col-sm-2 control-label">库存量</label>
                    <div class="col-sm-8">
                        <input type="number" class="form-control"
                               id="inventory" name="inventory"
                               value="${entity.inventory}"
                               placeholder="请输入库存量(实际库存量)"
                               minlength="0" maxlength="100"
                        />
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-sm-12" style="text-align: center;">
                        <input type="submit" class="btn btn-primary" value="保存"/>
                    </div>
                </div>

            </form>

        </div>
    </div>
</div>
<script type="text/javascript">
    window.parent.changeTitle('编辑产品参数');
    $(function () {
        initForm('#createForm', '${ctx}/admin/cms/production/updateProductionParams', function (r) {
            var resp = $.parseJSON(r);
            if (resp.code == 'OK') {
                window.parent.layer.closeAll();
                topLayer.msg('保存成功', {icon: 1});
                changeUrl('${ctx}/admin/cms/production');
            } else {
                topLayer.msg(resp.message, {icon: 2});
            }
        });
    });
</script>
</body>
</html>
